package com.gisocn.onemap.ui.popupwindow;

import android.content.Context;
import android.graphics.drawable.BitmapDrawable;
import android.view.View;
import android.widget.PopupWindow;
import android.widget.TextView;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.gisocn.onemap.interfaces.OnItemClickChildListener;
import com.gisocn.onemap.model.VectorQuery;
import com.gisocn.onemap.sgzx.R;
import com.gisocn.onemap.ui.adapter.QueryLandAdapter;
import java.util.ArrayList;

/* loaded from: classes2.dex */
public class LandInfoPopWindow extends PopupWindow {
    private QueryLandAdapter adapter;
    private Context context;
    private int height;
    boolean isCollection;
    private ArrayList<VectorQuery> list;
    private OnItemClickChildListener onItemClickListener = null;
    private int width;

    public void getDeatilInfo() {
    }

    public LandInfoPopWindow(ArrayList<VectorQuery> arrayList, Context context, int i, int i2) {
        this.context = context;
        this.width = i;
        this.height = i2;
        this.list = arrayList;
        initView();
    }

    public void setOnItemClickListener(OnItemClickChildListener onItemClickChildListener) {
        this.onItemClickListener = onItemClickChildListener;
    }

    private void initView() {
        this.isCollection = false;
        final View inflate = View.inflate(this.context, R.layout.popup_query_land, null);
        setContentView(inflate);
        setWidth(this.width);
        setHeight(this.height);
        setFocusable(false);
        setOutsideTouchable(false);
        setBackgroundDrawable(new BitmapDrawable());
        RecyclerView recyclerView = (RecyclerView) inflate.findViewById(R.id.recycle_land_info);
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this.context);
        linearLayoutManager.setOrientation(1);
        this.adapter = new QueryLandAdapter(this.list, this.context);
        recyclerView.setLayoutManager(linearLayoutManager);
        recyclerView.setAdapter(this.adapter);
        this.adapter.setOnItemClickListener(new OnItemClickChildListener() { // from class: com.gisocn.onemap.ui.popupwindow.LandInfoPopWindow.1
            @Override // com.gisocn.onemap.interfaces.OnItemClickChildListener
            public void onItemClick(View view, int i, int i2) {
                if (LandInfoPopWindow.this.onItemClickListener != null) {
                    LandInfoPopWindow.this.onItemClickListener.onItemClick(inflate, i, i2);
                }
            }
        });
        ((TextView) inflate.findViewById(R.id.tv_close)).setOnClickListener(new View.OnClickListener() { // from class: com.gisocn.onemap.ui.popupwindow.LandInfoPopWindow.2
            @Override // android.view.View.OnClickListener
            public void onClick(View view) {
                LandInfoPopWindow.this.dismiss();
            }
        });
    }

    public void updata(ArrayList<VectorQuery> arrayList) {
        this.list.clear();
        this.list.addAll(arrayList);
        this.adapter.notifyDataSetChanged();
    }
}
